//
//  LGForumDetailTableViewCell.m
//  ligenyun
//
//  Created by Mac on 2018/4/10.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "LGforumReplayTableViewCell.h"

@interface  LGforumReplayTableViewCell()
@property(nonatomic, strong) STButton     *iconButton;
@property(nonatomic, strong) STLabel     *titleLable;
@property(nonatomic, strong) STLabel     *desLable;
@property(nonatomic, strong) STLabel     *timeLable;
@property(nonatomic, strong) STButton     *peopleButton;//废弃
@end
@implementation LGforumReplayTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 115;
}
#pragma mark --subView
- (void)configSubView{
    self.iconButton = [[STButton alloc] initWithFrame:CGRectMake(15, 10, 60, 60)
                                                title:nil
                                           titleColor:nil
                                            titleFont:0
                                         cornerRadius:30
                                      backgroundColor:nil
                                      backgroundImage:[UIImage imageNamed:@"1"]
                                                image:nil];
    [self addSubview:self.iconButton];
    
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right + 10,10, UIScreenWidth - self.iconButton.right, 20)
                                                     text:@"stoneobs"
                                                textColor:FirstTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    self.titleLable = titleLable;
    [NSString lableAutoAdjustWitdhWithLabel:titleLable];
    [self addSubview:self.titleLable];
    
    
    NSDate * date = [NSDate st_localCurrentDate];
    STLabel * timeLable = [[STLabel alloc] initWithFrame:CGRectMake(self.titleLable.right+30,10, 50, 20)
                                                    text:date.st_dynamicFormater
                                               textColor:SecendTextColor
                                                    font:11
                                             isSizetoFit:NO
                                           textAlignment:NSTextAlignmentLeft];
    self.timeLable = timeLable;
    [self addSubview:self.timeLable];
    
    
    STLabel * desLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right+ 10,self.titleLable.bottom, UIScreenWidth - self.iconButton.right - 15, 40)
                                                   text:@"祭祀是华夏名族离店的一部分祭祀是华夏名族离店的一部分祭祀是华夏名族离店的一部分"
                                              textColor:SecendTextColor
                                                   font:12
                                            isSizetoFit:NO
                                          textAlignment:NSTextAlignmentLeft];
    self.desLable = desLable;
    [self addSubview:self.desLable];
    
    
    
    STButton * peopleButton = [[STButton alloc] initWithFrame:CGRectMake(titleLable.left ,desLable.bottom , 140, 44)
                                                        title:@"丽芳 等人 共32条回复"
                                                   titleColor:TM_redColor
                                                    titleFont:14
                                                 cornerRadius:0
                                              backgroundColor:nil
                                              backgroundImage:nil
                                                        image:nil];
    self.peopleButton = peopleButton;
    NSAttributedString * attStr = [peopleButton.currentTitle st_convertAttributeStringWithKeyWords:@[@"等人",@"共",@"条回复"] attributes:@[@{NSForegroundColorAttributeName:SecendTextColor},@{NSForegroundColorAttributeName:SecendTextColor},@{NSForegroundColorAttributeName:SecendTextColor}]];
    [peopleButton setAttributedTitle:attStr forState:UIControlStateNormal];
  //  [self addSubview:peopleButton];
    
    
    
    self.goodButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)
                                                title:nil
                                           titleColor:nil
                                            titleFont:0
                                         cornerRadius:0
                                      backgroundColor:nil
                                      backgroundImage:nil
                                                image:[UIImage imageNamed:@"已点赞"]];
    self.goodButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    self.goodButton.centerY = self.peopleButton.centerY;
    self.goodButton.left = self.peopleButton.right + 20;
    [self addSubview:self.goodButton];
    
    
    self.commentButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)
                                                   title:nil
                                              titleColor:nil
                                               titleFont:0
                                            cornerRadius:0
                                         backgroundColor:nil
                                         backgroundImage:nil
                                                   image:[UIImage imageNamed:@"论坛_消息"]];
    self.commentButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    self.commentButton.centerY = self.peopleButton.centerY;
    self.commentButton.left = self.goodButton.right ;
    [self addSubview:self.commentButton];
}

@end

